<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Scenery.asp"-->
<html>
	<head>
		<meta name="description" content="Once the exclusive domain of monastics and clerics, 
		retreats have become commonplace in the spiritual journey of the laity. 
		In a world where it has become difficult to find the holy, retreats provide the space and 
		time to rediscover the mystery of being loved by God. There is no right or wrong way to 
		make a retreat; there is simply the individual and God, and a mysterious deepening of one's 
		love for God.">
		
		<meta name="keywords" content="retreats, spiritual journey, laity, love for God, renewal, 
		Redemptorists, Milwaukee, Wisconsin, Chicago, Illinois, Madison, spiritual renewal, 
		holiness, Jesus Christ, Christianity, St. Alphonsus, Liguori, poor, marginalized, missions, 
		evangelize, evangelization, Catholic, Catholicism, saints, Holy Spirit, God, mystery, Celtic
		Spirituality, Contemplative, Franciscan, Sacraments, personal growth, spiritual enrichment, vocations
		priests, CSSR, cssr">
		<link rel="stylesheet" type="text/css" href="RRC.css">
		<%
			RCat = Request.QueryString("RCat")
		%>
		<title><%=RCat%></title>
		
	</head>

	<body>
		<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
			<tr valign="top"> 
				<td width="20%">
					<!-- #include file="MenuSide.asp" -->
				</td>
				<td align="middle">
					<div class="Header">
						<h1><%=RCat%></h1>
					</div>
					<!-- =========== Start of Page Content =========== -->
						<%
						If Len(RCat) > 0 Then
							Dim Filename, FileValue, fso, MyFile
							Dim Names(), Titles(), Name, Category, Title
							ReDim Names(1)
							ReDim Titles(1)
								
							Dim i
								
							Const ForReading=1, ForWriting=2
								
							FileName = Server.MapPath("Text/db.txt")
							Set fso = Server.CreateObject("Scripting.FileSystemObject")
							Set MyFile = fso.OpenTextFile(FileName, ForReading)
								Do While Not MyFile.AtEndOfStream
									FileValue = MyFile.ReadLine
									'Response.Write "<b>FileValue = </b>" & FileValue & "<br>"
										
									If Left(FileValue, 6) = "[Name]" Then
										Name = Right(FileValue, Len(FileValue) - 6)
										'AddName Name
									End If
										
									If Left(FileValue, 7) = "[Title]" Then
										Title = Right(FileValue, Len(FileValue) - 7)
										'AddTitle Title
									End If
										
									'If Left(FileValue, 10) = "[Category]" Then
									'	Category = Right(FileValue, Len(FileValue) - 10)
									'	If Category = RCat Then
									'		AddName Name
									'		AddTitle Title
									'	End If
									'End If
									
									If Left(FileValue, 10) = "[Category]" Then
										'Response.Write "FileValue = " & FileValue & "<br>"
										'Response.Write "RCat = " & RCat & "<br>"
										'On Error Resume Next
										If Instr(1, FileValue, RCat, 1) > 0 Then
										'Category = Right(FileValue, Len(FileValue) - 10)
										'If Category = RCat Then
											AddName Name
											AddTitle Title
										End If
									End If
									
								Loop
							MyFile.Close
							Set fso = Nothing
							'Add random Picture to top of page	
							Response.write GetImage & "<br>"
							Response.Write "<p class=Menu>"
							If UBound(Names) > 1 Then
								For i = 0 to UBound(Titles) - 1
									Response.Write "<a href='ShowRetreat.asp?RetreatName=" & Names(i) & "'>" & Titles(i) & "</a><br>"
								Next
								Response.Write "</p>"
							Else
								Response.Write "Sorry, there aren't any retreats currently available for this category."
							End If
						Else
							Response.Write "<div align=center>We're sorry, this category of retreats is currently not available.<br>"
						End If
								
							Sub AddName(NameVal)
								Dim i
									
								i = UBound(Names)
								Names(i) = NameVal
								ReDim Preserve Names(i+1)
							End Sub
								
							Sub AddTitle(TitleVal)
								Dim i
									
								i = UBound(Titles)
								Titles(i) = TitleVal
								ReDim Preserve Titles(i + 1)
							End Sub
									
						%>
					<!-- ===========  End of Page Content  =========== -->
				</td>
			</tr>
			<tr> 
				<td>&nbsp;</td>
				<td><!-- #include file="MenuBottom.asp" -->
				</td>
			</tr>
		</table>
	</body>
</html>
